{extend name="template/base" /}
{block name="style"}

{/block}
{block name="content"}

<div class="page-container">
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}">
        <input type="hidden" name="id" value="{$vo.id ?? ''}">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>主要负责区域：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <!-- 大区 -->
                <select name="REGION" id="REGION"  class="area">
                    <option value="">请选择</option>
                    {volist name="region1" id="data"}
                    <option value="{$data.areaCode}" {if $data.areaCode eq $vo.REGION}selected="true"{/if}>{$data.areaName}</option>
                    {/volist}
                </select>
                <!-- 省份 -->
                <select name="PROVINCE" id="PROVINCE"  class="area">
                    <option value="">请选择</option>
                    {volist name="region2" id="data"}
                    <option value="{$data.areaCode}" {if $data.areaCode eq $vo.PROVINCE}selected="true"{/if}>{$data.areaName}</option>
                    {/volist}
                </select>
                <!-- 城市 -->
                <select name="CITY" id="CITY" onselect="changeOption()"  class="area">
                    <option value="">请选择</option>
                    {volist name="region3" id="data"}
                    <option value="{$data.areaCode}" {if $data.areaCode eq $vo.CITY}selected="true"{/if} >{$data.areaName}</option>
                    {/volist}
                </select>
                <!-- 区县 -->
                <select name="AREA" id="AREA">
                    <option value="">请选择</option>
                    {volist name="region4" id="data"}
                    <option value="{$data.areaCode}" {if $data.areaCode eq $vo.AREA}selected="true"{/if}>{$data.areaName}</option>
                    {/volist}
                </select>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>代理公司名称：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="代理公司名称" name="COMPANY_NAME" value="{$vo.COMPANY_NAME ?? ''}"  datatype="*" nullmsg="请填写代理公司名称">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>联系人姓名：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="联系人姓名" name="CONTACTS_NAME" value="{$vo.CONTACTS_NAME ?? ''}"  datatype="*" nullmsg="请填写联系人姓名">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>联系电话：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="联系电话" name="CONTACTS_PHONE" value="{$vo.CONTACTS_PHONE ?? ''}"  datatype="*" nullmsg="请填写联系电话">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>负责人：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="负责人" name="LEADER_NAME" value="{$vo.LEADER_NAME ?? ''}"  datatype="*" nullmsg="请填写负责人">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>法人手机号码：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="法人手机号码" name="LEADER_PHONE" value="{$vo.LEADER_PHONE ?? ''}"  datatype="*" nullmsg="请填写法人手机号码">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>证件号：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="证件号" name="CERTIFICATE_NO" value="{$vo.CERTIFICATE_NO ?? ''}"  datatype="*" nullmsg="请填写证件号">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">证件类型：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="证件类型" name="CERTIFICATE_TYPE" value="{$vo.CERTIFICATE_TYPE ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">结算方式：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="结算方式" name="SETTLE_TYPE" value="{$vo.SETTLE_TYPE ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>结算账号：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="结算账号" name="SETTLE_ACCOUNT" value="{$vo.SETTLE_ACCOUNT ?? ''}"  datatype="*" nullmsg="请填写结算账号">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">认证人姓名：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="认证人姓名" name="AUTH_NAME" value="{$vo.AUTH_NAME ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">主要负责区域：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="主要负责区域" name="ACTIVE_AREA" value="{$vo.ACTIVE_AREA ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>





        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">备注：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="备注" name="REMARK" value="{$vo.REMARK ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">支付宝对应的USER_ID：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="支付宝对应的USER_ID" name="ALIPAY_USER_ID" value="{$vo.ALIPAY_USER_ID ?? ''}" >
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>

<script>
    var childArea;
    $(document).ready(function(){
        $(".area").change(function(){
            childArea = $(this).next();
            $.get("/api/index/sonAreaInfoList/parentAreaCode/"+$(this).val(),function(data,status){
                childArea.find("option").not(":first").remove();
                childArea.find("option").remove();
                for (var k = 0, length = data.list.length; k < length; k++) {
                    childArea.append("<option value='"+data.list[k].areaCode+"'>"+data.list[k].areaName+"</option>");
                }

            });
        });
    });

    $(function () {

        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret){
                ajax_progress(ret);
            }
        });
    })
</script>
{/block}
